package com.ciwong.epaper.modules.epaper.adapter;

import android.content.Context;
import android.media.MediaPlayer;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ExpandableListView;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.epaper.bean.FollowReadWordDetailBean;

import java.util.List;


public class ChooseWordListAdapter extends BaseAdapter {

    private List<FollowReadWordDetailBean> followReadWordDetailBeanList;
    private Context mContext;
    private ChooseWordExAdapter chooseWordExAdapter;
    private MediaPlayer mediaPlayer;

    public ChooseWordListAdapter(Context mContext,List<FollowReadWordDetailBean> followReadWordDetailBeans,MediaPlayer mediaPlayer){
        this.mContext = mContext;
        this.followReadWordDetailBeanList = followReadWordDetailBeans;
        this.mediaPlayer = mediaPlayer;
    }

    @Override
    public int getCount() {
        return null == followReadWordDetailBeanList ? 0 : followReadWordDetailBeanList.size();
    }

    @Override
    public Object getItem(int i) {
         return null == followReadWordDetailBeanList ? null : followReadWordDetailBeanList.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (null == view){
            view = View.inflate(mContext, R.layout.activity_choose_word_list_item,null);
        }
        ExpandableListView expandableListView = view.findViewById(R.id.choose_word_ex_list);
        return view;
    }
}
